import {request} from "./core";
import METHOD from "./methods";
import URL from "./url";

const APIClient={
    install(Vue){
        Vue.prototype.$API=this
    },
    getLogin(mobile,password){
      return request(METHOD.POST,URL.LOGIN,{mobile:mobile,pwd:password})
    },
    getStoreList(){
      return request(METHOD.GET,URL.STORELIST)
    },
    getBanner(){
      return request(METHOD.GET,URL.BANNER)
    },
    getBargain(){
      return request(METHOD.POST,URL.BARGAIN)
    },
    getScroll(){
      return request(METHOD.GET,URL.SCROLL)
    },
    getRecommend(){
      return request(METHOD.GET,URL.RECOMMEND)
    },
    getScrollDetail(params){
      return request(METHOD.GET,URL.SCROLLDETAIL,{params})
    },
    getGoodsList(){
      return request(METHOD.POST,URL.GOODSLIST)
    },
    getRecommendDetail(params){
      return request(METHOD.GET,URL.LISTDETAIL,{params})
    },
}

export default APIClient;